package com.pachong.service.impl;

import com.domain.bean.music.MusicComment;
import com.pachong.common.impl.BaseServiceImpl;
import com.pachong.service.MusicCommentService;
import com.wy.dao.music.MusicCommentDAO;
import com.wy.dao.sys.BaseDAO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * Author : wangyu
 * Date: 2018-03-05
 * Time: 14:07
 */
@Service
public class MusicCommentServiceImpl extends BaseServiceImpl<MusicComment,Integer> implements MusicCommentService {

    @Autowired
    private MusicCommentDAO musicCommentDAO;

    @Override
    public BaseDAO<MusicComment, Integer> getBaseDao() {
        return musicCommentDAO;
    }

    @Override
    public void batchingSave(List<MusicComment> users) {
        if(users == null || users.isEmpty()){
            return;
        }
        musicCommentDAO.save(users);
    }

    @Override
    public MusicComment selectByCommentId(String commentId) {
        if(StringUtils.isBlank(commentId)){
            return null;
        }
        return musicCommentDAO.findByCommentId(commentId);
    }
}
